/*-----------------------------------------------------------------
Replication do-file for article: "Biased, Not Blind: An Experimental Test of Self-Serving Biases in Service Users’ Evaluations of Public Performance" 
Author: Julian Christensen, Aarhus University
-----------------------------------------------------------------*/

use "Christensen_PA_BiasedNotBlind_DATA.dta", clear
set more off

/*
NOTE TO READER:

The dataset includes the following variables:

- socialactivities_AUbest: Dummy indicating whether respondents have seen Aarhus University (1) or comparison university (0) as best performing in experiment 1.
- generallysatisfied_AUbest: Dummy indicating whether respondents have seen Aarhus University (1) or comparison university (0) as best performing in experiment 2. 
- enougteaching_AUbest: Dummy indicating whether respondents have seen Aarhus University (1) or comparison university (0) as best performing in experiment 3.
- socialactivitiesimportant: Perceived importance of information (dependent variable) in experiment 1.
- gennerallysatisfiedimportant: Perceived importance of information (dependent variable) in experiment 2.
- enougteachingimportant: Perceived importance of information (dependent variable) in experiment 3.
- comparison_CPH: Dummy indicating whether University of Copenhagen (1) or University of Southern Denmark (0) was used as comparison university in the experiments.
- PolSci: Dummy indicating whether respondents were Political Science students (1) or not (0) when responding to the survey.
- AU_firstpriority: Dummy indicating whether respondents had Political Science at Aarhus University as their first priority (1) or not (0) when applying for enrolment in a degree program.
- female: Dummy indicating the gender of the respondents (female = 1; male = 0).
- age: Variable measuring age of the respondents.
- fatherfurtheredu: Dummy indicating whether respondent's father has a higher education (1) or not (0).
- motherfurtheredu: Dummy indicating whether respondent's mother has a higher education (1) or not (0).
- leftright: Self-identified left-right orientation (0 = left wing; 10 = right wing).
- leftwingvoter: Dummy indicating whether respondents would vote for a left wing party (1) or not (0) in case of a parliamentary election at the time of the data collection.
- govsymp: Variable measuring sympathy with the government of Denmark at the time of the data collection (0 = very low sympathy; 10 = very high sympathy).
- partyidentification: Dymmy indicating whether respondents identify with a political party (1) or not (0).
- year2015: Dummy indicating year of data collection (2015 = 1; 2016 or 2017 = 0)
- year2016: Dummy indicating year of data collection (2016 = 1; 2015 or 2017 = 0) 
- year2017: Dummy indicating year of data collection (2017 = 1; 2015 or 2016 = 0)
- AUbestsocialXmotheredu: Interaction term (socialactivities_AUbest * motherfurtheredu).
- AUbestgeneralXmotheredu: Interaction term (generallysatisfied_AUbest * motherfurtheredu).
- AUbestgeneralXrightwing: Interaction term (generallysatisfied_AUbest * leftright).
- AUbestgeneralXgovsympathy: Interaction term (generallysatisfied_AUbest * govsymp).
- AUbest_SocialXcomparison_CPH: Interaction term (socialactivities_AUbest * comparison_CPH).
- AUbest_GeneralXcomparison_CPH Interaction term (generallysatisfied_AUbest * comparison_CPH).
- AUbest_EnoughXcomparison_CPH: Interaction term (enougteaching_AUbest * comparison_CPH).
- AUbest_SocialX2016: Interaction term (socialactivities_AUbest * year2016).
- AUbest_SocialX2017: Interaction term (socialactivities_AUbest * year2017).
- AUbest_GeneralX2016: Interaction term (generallysatisfied_AUbest * year2016).
- AUbest_GeneralX2017: Interaction term (generallysatisfied_AUbest * year2017).
- AUbest_EnoughX2016: Interaction term (enougteaching_AUbest * year2016).
- AUbest_EnoughX2017: Interaction term (enougteaching_AUbest * year2017).
*/

***FIGURE 2: HYPOTHESIS TEST***

*Experiment 1
ttest socialactivitiesimportant if AU_firstpriority==1 & PolSci==1 & year2015==1, by(socialactivities_AUbest)
esize twosample socialactivitiesimportant if AU_firstpriority==1 & PolSci==1 & year2015==1, by(socialactivities_AUbest)
ttest socialactivitiesimportant if AU_firstpriority==1 & PolSci==1 & year2016==1, by(socialactivities_AUbest)
esize twosample socialactivitiesimportant if AU_firstpriority==1 & PolSci==1 & year2016==1, by(socialactivities_AUbest)
ttest socialactivitiesimportant if AU_firstpriority==1 & PolSci==1 & year2017==1, by(socialactivities_AUbest)
esize twosample socialactivitiesimportant if AU_firstpriority==1 & PolSci==1 & year2017==1, by(socialactivities_AUbest)
*Experiment 2
ttest gennerallysatisfiedimportant if AU_firstpriority==1 & PolSci==1 & year2015==1, by(generallysatisfied_AUbest)
esize twosample gennerallysatisfiedimportant if AU_firstpriority==1 & PolSci==1 & year2015==1, by(generallysatisfied_AUbest)
ttest gennerallysatisfiedimportant if AU_firstpriority==1 & PolSci==1 & year2016==1, by(generallysatisfied_AUbest)
esize twosample gennerallysatisfiedimportant if AU_firstpriority==1 & PolSci==1 & year2016==1, by(generallysatisfied_AUbest)
ttest gennerallysatisfiedimportant if AU_firstpriority==1 & PolSci==1 & year2017==1, by(generallysatisfied_AUbest)
esize twosample gennerallysatisfiedimportant if AU_firstpriority==1 & PolSci==1 & year2017==1, by(generallysatisfied_AUbest)
*Experiment 3
ttest enougteachingimportant if AU_firstpriority==1 & PolSci==1 & year2015==1, by(enougteaching_AUbest)
esize twosample enougteachingimportant if AU_firstpriority==1 & PolSci==1 & year2015==1, by(enougteaching_AUbest)
ttest enougteachingimportant if AU_firstpriority==1 & PolSci==1 & year2016==1, by(enougteaching_AUbest)
esize twosample enougteachingimportant if AU_firstpriority==1 & PolSci==1 & year2016==1, by(enougteaching_AUbest)
ttest enougteachingimportant if AU_firstpriority==1 & PolSci==1 & year2017==1, by(enougteaching_AUbest)
esize twosample enougteachingimportant if AU_firstpriority==1 & PolSci==1 & year2017==1, by(enougteaching_AUbest)

***FIGURE 3: POOLED HYPOTHESIS TEST***

*Experiment 1
ttest socialactivitiesimportant if AU_firstpriority==1 & PolSci==1, by(socialactivities_AUbest)
esize twosample socialactivitiesimportant if AU_firstpriority==1 & PolSci==1, by(socialactivities_AUbest)
*Experiment 2
ttest gennerallysatisfiedimportant if AU_firstpriority==1 & PolSci==1, by(generallysatisfied_AUbest)
esize twosample gennerallysatisfiedimportant if AU_firstpriority==1 & PolSci==1, by(generallysatisfied_AUbest)
*Experiment 3
ttest enougteachingimportant if AU_firstpriority==1 & PolSci==1, by(enougteaching_AUbest)
esize twosample enougteachingimportant if AU_firstpriority==1 & PolSci==1, by(enougteaching_AUbest)

***APPENDIX A1: POOLED HYPOTHESIS TEST INCLUDING RESPONDENTS WHO DID NOT CHOOSE AARHUS UNIVERSITY AS FIRST PRIORITY***

*Experiment 1
ttest socialactivitiesimportant if PolSci==1, by(socialactivities_AUbest)
*Experiment 2
ttest gennerallysatisfiedimportant if PolSci==1, by(generallysatisfied_AUbest)
*Experiment 3
ttest enougteachingimportant if PolSci==1, by(enougteaching_AUbest)

***ONLINE SUPPORTING INFORMATION S1: BALANCE TESTS 2015***

*Female
prtest female if AU_firstpriority==1 & PolSci==1 & year2015==1, by(socialactivities_AUbest)
prtest female if AU_firstpriority==1 & PolSci==1 & year2015==1, by(generallysatisfied_AUbest)
prtest female if AU_firstpriority==1 & PolSci==1 & year2015==1, by(enougteaching_AUbest)
*Age
ttest age if AU_firstpriority==1 & PolSci==1 & year2015==1, by(socialactivities_AUbest)
ttest age if AU_firstpriority==1 & PolSci==1 & year2015==1, by(generallysatisfied_AUbest)
ttest age if AU_firstpriority==1 & PolSci==1 & year2015==1, by(enougteaching_AUbest)
*Father has higher education (0=no, 1=yes)
prtest fatherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2015==1, by(socialactivities_AUbest)
prtest fatherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2015==1, by(generallysatisfied_AUbest)
prtest fatherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2015==1, by(enougteaching_AUbest)
*Mother has higher education (0=no, 1=yes)
prtest motherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2015==1, by(socialactivities_AUbest)
prtest motherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2015==1, by(generallysatisfied_AUbest)
prtest motherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2015==1, by(enougteaching_AUbest)
*Left-right orientation (0-10 with higher values indicating right wing)
ttest leftright if AU_firstpriority==1 & PolSci==1 & year2015==1, by(socialactivities_AUbest)
ttest leftright if AU_firstpriority==1 & PolSci==1 & year2015==1, by(generallysatisfied_AUbest)
ttest leftright if AU_firstpriority==1 & PolSci==1 & year2015==1, by(enougteaching_AUbest)
*Sympathy towards current (September 2015) Venstre-government (0-10 with higher values indicating higher sympathy) 
ttest govsympathy if AU_firstpriority==1 & PolSci==1 & year2015==1, by(socialactivities_AUbest)
ttest govsympathy if AU_firstpriority==1 & PolSci==1 & year2015==1, by(generallysatisfied_AUbest)
ttest govsympathy if AU_firstpriority==1 & PolSci==1 & year2015==1, by(enougteaching_AUbest)
*Identify with a party
prtest partyidentification if AU_firstpriority==1 & PolSci==1 & year2015==1, by(socialactivities_AUbest)
prtest partyidentification if AU_firstpriority==1 & PolSci==1 & year2015==1, by(generallysatisfied_AUbest)
prtest partyidentification if AU_firstpriority==1 & PolSci==1 & year2015==1, by(enougteaching_AUbest)
*Left-wing voter (if parliamentary election the day after the data collection)
prtest leftwingvoter if AU_firstpriority==1 & PolSci==1 & year2015==1, by(socialactivities_AUbest)
prtest leftwingvoter if AU_firstpriority==1 & PolSci==1 & year2015==1, by(generallysatisfied_AUbest)
prtest leftwingvoter if AU_firstpriority==1 & PolSci==1 & year2015==1, by(enougteaching_AUbest)

***ONLINE SUPPORTING INFORMATION S2: BALANCE TESTS 2016***

*Female
prtest female if AU_firstpriority==1 & PolSci==1 & year2016==1, by(socialactivities_AUbest)
prtest female if AU_firstpriority==1 & PolSci==1 & year2016==1, by(generallysatisfied_AUbest)
prtest female if AU_firstpriority==1 & PolSci==1 & year2016==1, by(enougteaching_AUbest)
*Age
ttest age if AU_firstpriority==1 & PolSci==1 & year2016==1, by(socialactivities_AUbest)
ttest age if AU_firstpriority==1 & PolSci==1 & year2016==1, by(generallysatisfied_AUbest)
ttest age if AU_firstpriority==1 & PolSci==1 & year2016==1, by(enougteaching_AUbest)
*Father has higher education (0=no, 1=yes)
prtest fatherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2016==1, by(socialactivities_AUbest)
prtest fatherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2016==1, by(generallysatisfied_AUbest)
prtest fatherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2016==1, by(enougteaching_AUbest)
*Mother has higher education (0=no, 1=yes)
prtest motherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2016==1, by(socialactivities_AUbest)
prtest motherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2016==1, by(generallysatisfied_AUbest)
prtest motherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2016==1, by(enougteaching_AUbest)
*Left-right orientation (0-10 with higher values indicating right wing)
ttest leftright if AU_firstpriority==1 & PolSci==1 & year2016==1, by(socialactivities_AUbest)
ttest leftright if AU_firstpriority==1 & PolSci==1 & year2016==1, by(generallysatisfied_AUbest)
ttest leftright if AU_firstpriority==1 & PolSci==1 & year2016==1, by(enougteaching_AUbest)
*Sympathy towards current (September 2016) Venstre-government (0-10 with higher values indicating higher sympathy) 
ttest govsympathy if AU_firstpriority==1 & PolSci==1 & year2016==1, by(socialactivities_AUbest)
ttest govsympathy if AU_firstpriority==1 & PolSci==1 & year2016==1, by(generallysatisfied_AUbest)
ttest govsympathy if AU_firstpriority==1 & PolSci==1 & year2016==1, by(enougteaching_AUbest)
*Left-wing voter (if parliamentary election the day after the data collection)
prtest leftwingvoter if AU_firstpriority==1 & PolSci==1 & year2016==1, by(socialactivities_AUbest)
prtest leftwingvoter if AU_firstpriority==1 & PolSci==1 & year2016==1, by(generallysatisfied_AUbest)
prtest leftwingvoter if AU_firstpriority==1 & PolSci==1 & year2016==1, by(enougteaching_AUbest)

***ONLINE SUPPORTING INFORMATION S3: BALANCE TESTS 2017***

*Female
prtest female if AU_firstpriority==1 & PolSci==1 & year2017==1, by(socialactivities_AUbest)
prtest female if AU_firstpriority==1 & PolSci==1 & year2017==1, by(generallysatisfied_AUbest)
prtest female if AU_firstpriority==1 & PolSci==1 & year2017==1, by(enougteaching_AUbest)
*Age
ttest age if AU_firstpriority==1 & PolSci==1 & year2017==1, by(socialactivities_AUbest)
ttest age if AU_firstpriority==1 & PolSci==1 & year2017==1, by(generallysatisfied_AUbest)
ttest age if AU_firstpriority==1 & PolSci==1 & year2017==1, by(enougteaching_AUbest)
*Father has higher education (0=no, 1=yes)
prtest fatherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2017==1, by(socialactivities_AUbest)
prtest fatherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2017==1, by(generallysatisfied_AUbest)
prtest fatherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2017==1, by(enougteaching_AUbest)
*Mother has higher education (0=no, 1=yes)
prtest motherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2017==1, by(socialactivities_AUbest)
prtest motherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2017==1, by(generallysatisfied_AUbest)
prtest motherfurtheredu if AU_firstpriority==1 & PolSci==1 & year2017==1, by(enougteaching_AUbest)
*Left-right orientation (0-10 with higher values indicating right wing)
ttest leftright if AU_firstpriority==1 & PolSci==1 & year2017==1, by(socialactivities_AUbest)
ttest leftright if AU_firstpriority==1 & PolSci==1 & year2017==1, by(generallysatisfied_AUbest)
ttest leftright if AU_firstpriority==1 & PolSci==1 & year2017==1, by(enougteaching_AUbest)
*Sympathy towards current (September 2017) government with ministers from Venstre, Konservative, and Liberal Alliance (0-10 with higher values indicating higher sympathy) 
ttest govsympathy if AU_firstpriority==1 & PolSci==1 & year2017==1, by(socialactivities_AUbest)
ttest govsympathy if AU_firstpriority==1 & PolSci==1 & year2017==1, by(generallysatisfied_AUbest)
ttest govsympathy if AU_firstpriority==1 & PolSci==1 & year2017==1, by(enougteaching_AUbest)
*Left-wing voter (if parliamentary election the day after the data collection)
prtest leftwingvoter if AU_firstpriority==1 & PolSci==1 & year2017==1, by(socialactivities_AUbest)
prtest leftwingvoter if AU_firstpriority==1 & PolSci==1 & year2017==1, by(generallysatisfied_AUbest)
prtest leftwingvoter if AU_firstpriority==1 & PolSci==1 & year2017==1, by(enougteaching_AUbest)

***ONLINE SUPPORTING INFORMATION S4: TEST FOR STATISTICALLY SIGNIFICANT DIFFERENCES IN EFFECT SIZES DEPENDING ON COMPARISON UNIVERSITY***

*Experiment 1
reg socialactivitiesimportant socialactivities_AUbest comparison_CPH AUbest_SocialXcomparison_CPH if AU_firstpriority ==1 & PolSci==1
*Experiment 2
reg gennerallysatisfiedimportant generallysatisfied_AUbest comparison_CPH AUbest_GeneralXcomparison_CPH if AU_firstpriority ==1 & PolSci==1
*Experiment 3
reg enougteachingimportant enougteaching_AUbest comparison_CPH AUbest_EnoughXcomparison_CPH if AU_firstpriority ==1 & PolSci==1

***ONLINE SUPPORTING INFORMATION S5: TEST FOR STATISTICALLY SIGNIFICANT DIFFERENCES IN EFFECT SIZES ACROSS SAMPLES: 2015 VS. 2016***

*Experiment 1
reg socialactivitiesimportant socialactivities_AUbest year2016 AUbest_SocialX2016 if AU_firstpriority ==1 & PolSci==1 & year2017==0
*Experiment 2
reg gennerallysatisfiedimportant generallysatisfied_AUbest year2016 AUbest_GeneralX2016 if AU_firstpriority ==1 & PolSci==1 & year2017==0
*Experiment 3
reg enougteachingimportant enougteaching_AUbest year2016 AUbest_EnoughX2016 if AU_firstpriority ==1 & PolSci==1 & year2017==0

****ONLINE SUPPORTING INFORMATION S6: TEST FOR STATISTICALLY SIGNIFICANT DIFFERENCES IN EFFECT SIZES ACROSS SAMPLES: 2015 VS. 2017***

*Experiment 1
reg socialactivitiesimportant socialactivities_AUbest year2017 AUbest_SocialX2017 if AU_firstpriority ==1 & PolSci==1 & year2016==0
*Experiment 2
reg gennerallysatisfiedimportant generallysatisfied_AUbest year2017 AUbest_GeneralX2017 if AU_firstpriority ==1 & PolSci==1 & year2016==0
*Experiment 3
reg enougteachingimportant enougteaching_AUbest year2017 AUbest_EnoughX2017 if AU_firstpriority ==1 & PolSci==1 & year2016==0

*****ONLINE SUPPORTING INFORMATION S7: TEST FOR STATISTICALLY SIGNIFICANT DIFFERENCES IN EFFECT SIZES ACROSS SAMPLES: 2016 VS. 2017***

*Experiment 1
reg socialactivitiesimportant socialactivities_AUbest year2017 AUbest_SocialX2017 if AU_firstpriority ==1 & PolSci==1 & year2015==0
*Experiment 2
reg gennerallysatisfiedimportant generallysatisfied_AUbest year2017 AUbest_GeneralX2017 if AU_firstpriority ==1 & PolSci==1 & year2015==0
*Experiment 3
reg enougteachingimportant enougteaching_AUbest year2017 AUbest_EnoughX2017 if AU_firstpriority ==1 & PolSci==1 & year2015==0

***ONLINE SUPPORTING INFORMATION S8: POWER ANALYSIS***

*Experiment 1 (average importance when other best = 4.56; when AU best = 5.21, average standard deviation on dependent var = 2.47)
power onemean 4.56 5.21, sd(2.47) n(1(10)1000) graph
power onemean 4.56 5.21, sd(2.47) n(203) 
power onemean 4.56 5.21, sd(2.47) n(195) 
power onemean 4.56 5.21, sd(2.47) n(216) 
power onemean 4.56 5.21, sd(2.47) n(615) 
power onemean 4.56 5.21, sd(2.47) power(0.8) 
*Experiment 2 (average importance when other best = 5.41; when AU best = 5.64, average standard deviation on dependent var = 2.49)
power onemean 5.41 5.64, sd(2.49) n(1(10)1000) graph
power onemean 5.41 5.64, sd(2.49) n(203)
power onemean 5.41 5.64, sd(2.49) n(195)
power onemean 5.41 5.64, sd(2.49) n(215)
power onemean 5.41 5.64, sd(2.49) n(614)
power onemean 5.41 5.64, sd(2.49) power(0.8)
*Experiment 3 (average importance when other best = 6.44; when AU best = 6.79, average standard deviation on dependent var = 2.32)
power onemean 6.44 6.79, sd(2.32) n(1(10)1000) graph
power onemean 6.44 6.79, sd(2.32) n(203)
power onemean 6.44 6.79, sd(2.32) n(195)
power onemean 6.44 6.79, sd(2.32) n(215)
power onemean 6.44 6.79, sd(2.32) n(614)
power onemean 6.44 6.79, sd(2.32) power(0.8)

***ADDITIONAL ANALYSEIS IN RESPONSE TO IMBALANCES (NOT REPORTED IN MANUSCRIPT BUT MENTIONED IN FOOTNOTE ON BALANCE CHECKS)***

*Mother education, experiment 1
reg socialactivitiesimportant socialactivities_AUbest motherfurtheredu AUbestsocialXmotheredu if AU_firstpriority ==1 & PolSci==1
*Mother education, experiment 2
reg gennerallysatisfiedimportant generallysatisfied_AUbest motherfurtheredu AUbestgeneralXmotheredu if AU_firstpriority ==1 & PolSci==1
*Left-right, experiment 2
reg gennerallysatisfiedimportant generallysatisfied_AUbest leftright AUbestgeneralXrightwing if AU_firstpriority ==1 & PolSci==1
*Sympathy towards government, experiment 2
reg gennerallysatisfiedimportant generallysatisfied_AUbest govsympathy AUbestgeneralXgovsympathy if AU_firstpriority ==1 & PolSci==1

